package edu.sctu.zhoumengxue.day201506.day20150607.threadPractice;

/**
 * Created by user12 on 2015/6/7.
 */
public class ThreadUtil {


    private int time;

    public ThreadUtil(int time) {
        this.time = time;

    }

    public void startThread() {


        new Thread() {
            public void run() {
                for (int i = 0; i < time; i++) {

                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(i);
                }

            }

        }.start();


    }
}

